package com.intellagric.controller.portal.iftmonitor;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.module.iftmonitor.CtrlEquipmentVo;
import com.intellagric.pojo.IftCtrlEquipment;
import com.intellagric.service.iftmonitor.ift_ctrl_equipment.CtrlEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2018/10/21
 * @DESC： 控制设备管理
 */
@Controller
public class CtrlEquipmentController {

    @Autowired
    private CtrlEquipmentService ctrlEquipmentService;

    /**
     * 查询控制设备信息
     * @return IftCtrlEquipment
     */
    @RequestMapping("/ctrlequipment/{id}")
    @ResponseBody
    public IftCtrlEquipment get(@PathVariable String id) {
        return ctrlEquipmentService.getCtrlEquipmentById(id);
    }

    /**
     * 查询控制设备信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/ctrlequipment/list")
    @ResponseBody
    public LayuiDataGridResult getList() {
        return ctrlEquipmentService.getCtrlEquipmentList();
    }

    /**
     * 多条件查询控制设备信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/ctrlequipment/query")
    @ResponseBody
    public LayuiDataGridResult getListByVo(CtrlEquipmentVo ctrlEquipmentVo) {
        return ctrlEquipmentService.getCtrlEquipmentListByVo(ctrlEquipmentVo);
    }

    /**
     * 分页查询控制设备信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/ctrlequipment/page")
    @ResponseBody
    public LayuiDataGridResult getPage(int page,int limit) {
        return ctrlEquipmentService.getCtrlEquipmentPage(page,limit);
    }


}
